home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 18 / 018.d81 / awg adsr toy (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  2KB  |  78 lines

  1. 10 rem    graphic adsr stuff
  2. 15 ifx=0then gosub60000
  3. 20 ifx=0thenx=1:load"sysplotterd.o",8,1
  4. 22 print"       press a key to continue"
  5. 24 poke198,0:wait198,1:geta$
  6. 25 poke650,255
  7. 30 :
  8. 35 sid=54272:hf=40:lf=100:vol=15
  9. 40 gr=49152:ng=49155:cl=49158:sm=49161
  10. 41 co=49164
  11. 42 line=49173:unl=49176:text=49179
  12. 95 :
  13. 100 sysgr:syscl:syssm,1:sysco,0
  14. 110 a=8:d=8:s=8:r=8:gosub400:goto293
  15. 120 :
  16. 200 sysline,0,200,ax,ay
  17. 210 sysline,ax,ay,dx,dy
  18. 220 sysline,dx,dy,sx,sy
  19. 230 sysline,sx,sy,rx,ry
  20. 240 :
  21. 242 s1=bx:s2=by:s3=ax:s4=ay
  22. 244 s5=dx:s6=dy:s7=sx:s8=sy
  23. 246 s9=rx:en=ry
  24. 248 :
  25. 250 poke198,0:wait198,1:geta$
  26. 251 ifa$="q"then63000
  27. 252 ifa$="p"thengosub600:goto250
  28. 260 ifa$="a"thena=a+1:ifa=16thena=0
  29. 263 gosub400
  30. 270 ifa$="d"thend=d+1:ifd=16thend=0
  31. 273 gosub400
  32. 280 ifa$="s"thens=s+1:ifs=16thens=0
  33. 283 gosub400
  34. 290 ifa$="r"thenr=r+1:ifr=16thenr=0
  35. 292 gosub400:syscl
  36. 293 t$="attack"+str$(a)+"  "+"decay"+str$(d):systext,t$,0,0
  37. 294 t$="sustain"+str$(s)+"  release"+str$(r):systext,t$,0,9
  38. 295 :
  39. 296 sysun,0,200,s3,s4:sysun,s3,s4,s5,s6:    sysun,s5,s6,s7,s8
  40. 297 sysun,s7,s8,s9,en
  41. 300 goto200
  42. 350 :
  43. 400 ax=a*5:ay=100
  44. 402 dx=ax+d*5:sy=100+(15-s)*3:dy=sy
  45. 404 sx=dx+40
  46. 406 rx=sx+r*5:ry=200
  47. 410 return
  48. 600 forx=sidtosid+23:pokex,0:next
  49. 602 pokesid+24,vol:poke53280,2
  50. 604 pokesid+5,a*16+d:pokesid+6,s*16+r
  51. 606 pokesid,lf:pokesid+1,hf:pokesid+4,33
  52. 608 fordl=1to300:ifpeek(198)=0thennext
  53. 609 poke198,0
  54. 610 pokesid+4,32:poke53280,6
  55. 612 return
  56. 60000 rem   title and instructions
  57. 60002 poke53281,1
  58. 60010 print"[147][144]"chr$(142):printspc(10)"** awg adsr tool **"
  59. 60020 print" (a) ==> changes attack"
  60. 60022 print" (d) ==> changes decay"
  61. 60024 print" (s) ==> changes sustain"
  62. 60026 print" (r) ==> changes release"
  63. 60028 print" (p) ==> plays current envelope"
  64. 60030 print" (q) ==> quit--returns to loadstar"
  65. 60040 print" values will change from 0 to 15 and"
  66. 60042 print" then back to zero (wrap around)."
  67. 60050 return
  68. 63000 rem  quit
  69. 63010 sysng:print"[147]"
  70. 63020 print"[196]o you really want to quit? ";
  71. 63030 poke198,0:wait198,1:geta$
  72. 63035 ifa$<>"y"anda$<>"n"then63030
  73. 63040 printa$
  74. 63050 ifa$="n"thenprint"[147]":goto100
  75. 63060 :
  76. 63070 load"hello connect",8
  77. 63080 end
  78.